package com.chinalin.h5_webrtc_host

import androidx.core.content.edit

object LastUrlUtils {

    private const val TAG = "LastUrlUtils.xml"
    private const val KEY_URL = "KEY_URL"
    private val context get() = TheApp.instance
    private val sp get() = context.getSharedPreferences(TAG, 0)

    fun setUrl(url: String) {
        sp.edit {
            putString(KEY_URL, url)
        }
    }

    fun getUrl(): String {
        return sp.getString(KEY_URL, "").orEmpty()
    }
}